package cn.sanshuilin.kst.system.provider.bean;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

/**
 * @author greenlee
 * @version v1.0
 * @create 创建时间: 2017-12-03 18:26
 * Copyright 2017  by 三水林科技有限公司
 **/
@Entity
@Table(name = "Comment")
public class Comment implements Serializable {
    private String id;
    private String attachmentIDs;
    private Integer categoryId;
    private String content;
    private Integer groupId;
    private String ip;
    private Integer isAnonymous;
    private String objId;
    private Timestamp pubDate;
    private String pubMemberId;
    private String pubMemberName;
    private String shareId;
    private String toMemberId;


    private Share share;
    private List<String> attachmentUrls;
    private String pubDateStr;
    private Member pubMember;
    private String objName;
    private Member toMember;
    private String groupName;
    @Transient
    public Share getShare() {
        return share;
    }
    @Transient
    public List<String> getAttachmentUrls() {
        return attachmentUrls;
    }
    @Transient
    public String getPubDateStr() {
        return pubDateStr;
    }
    @Transient
    public Member getPubMember() {
        return pubMember;
    }
    @Transient
    public String getObjName() {
        return objName;
    }
    @Transient
    public Member getToMember() {
        return toMember;
    }

    public void setShare(Share share) {
        this.share = share;
    }

    public void setAttachmentUrls(List<String> attachmentUrls) {
        this.attachmentUrls = attachmentUrls;
    }

    public void setPubDateStr(String pubDateStr) {
        this.pubDateStr = pubDateStr;
    }

    public void setPubMember(Member pubMember) {
        this.pubMember = pubMember;
    }

    public void setObjName(String objName) {
        this.objName = objName;
    }

    public void setToMember(Member toMember) {
        this.toMember = toMember;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    @Transient

    public String getGroupName() {
        return groupName;
    }

    @Id
    @Column(name = "ID", nullable = false, length = 255)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "AttachmentIDs", nullable = true, length = 255)
    public String getAttachmentIDs() {
        return attachmentIDs;
    }

    public void setAttachmentIDs(String attachmentIDs) {
        this.attachmentIDs = attachmentIDs;
    }

    @Basic
    @Column(name = "CategoryID", nullable = true)
    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    @Basic
    @Column(name = "Content", nullable = true, length = 255)
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "GroupID", nullable = true)
    public Integer getGroupId() {
        return groupId;
    }

    public void setGroupId(Integer groupId) {
        this.groupId = groupId;
    }

    @Basic
    @Column(name = "Ip", nullable = true, length = 255)
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Basic
    @Column(name = "IsAnonymous", nullable = true)
    public Integer getIsAnonymous() {
        return isAnonymous;
    }

    public void setIsAnonymous(Integer isAnonymous) {
        this.isAnonymous = isAnonymous;
    }

    @Basic
    @Column(name = "ObjID", nullable = true, length = 255)
    public String getObjId() {
        return objId;
    }

    public void setObjId(String objId) {
        this.objId = objId;
    }

    @Basic
    @Column(name = "PubDate", nullable = true)
    public Timestamp getPubDate() {
        return pubDate;
    }

    public void setPubDate(Timestamp pubDate) {
        this.pubDate = pubDate;
    }

    @Basic
    @Column(name = "PubMemberID", nullable = true, length = 255)
    public String getPubMemberId() {
        return pubMemberId;
    }

    public void setPubMemberId(String pubMemberId) {
        this.pubMemberId = pubMemberId;
    }

    @Basic
    @Column(name = "PubMemberName", nullable = true, length = 255)
    public String getPubMemberName() {
        return pubMemberName;
    }

    public void setPubMemberName(String pubMemberName) {
        this.pubMemberName = pubMemberName;
    }

    @Basic
    @Column(name = "ShareID", nullable = true, length = 255)
    public String getShareId() {
        return shareId;
    }

    public void setShareId(String shareId) {
        this.shareId = shareId;
    }

    @Basic
    @Column(name = "ToMemberID", nullable = true, length = 255)
    public String getToMemberId() {
        return toMemberId;
    }

    public void setToMemberId(String toMemberId) {
        this.toMemberId = toMemberId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Comment that = (Comment) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (attachmentIDs != null ? !attachmentIDs.equals(that.attachmentIDs) : that.attachmentIDs != null)
            return false;
        if (categoryId != null ? !categoryId.equals(that.categoryId) : that.categoryId != null) return false;
        if (content != null ? !content.equals(that.content) : that.content != null) return false;
        if (groupId != null ? !groupId.equals(that.groupId) : that.groupId != null) return false;
        if (ip != null ? !ip.equals(that.ip) : that.ip != null) return false;
        if (isAnonymous != null ? !isAnonymous.equals(that.isAnonymous) : that.isAnonymous != null) return false;
        if (objId != null ? !objId.equals(that.objId) : that.objId != null) return false;
        if (pubDate != null ? !pubDate.equals(that.pubDate) : that.pubDate != null) return false;
        if (pubMemberId != null ? !pubMemberId.equals(that.pubMemberId) : that.pubMemberId != null) return false;
        if (pubMemberName != null ? !pubMemberName.equals(that.pubMemberName) : that.pubMemberName != null)
            return false;
        if (shareId != null ? !shareId.equals(that.shareId) : that.shareId != null) return false;
        if (toMemberId != null ? !toMemberId.equals(that.toMemberId) : that.toMemberId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (attachmentIDs != null ? attachmentIDs.hashCode() : 0);
        result = 31 * result + (categoryId != null ? categoryId.hashCode() : 0);
        result = 31 * result + (content != null ? content.hashCode() : 0);
        result = 31 * result + (groupId != null ? groupId.hashCode() : 0);
        result = 31 * result + (ip != null ? ip.hashCode() : 0);
        result = 31 * result + (isAnonymous != null ? isAnonymous.hashCode() : 0);
        result = 31 * result + (objId != null ? objId.hashCode() : 0);
        result = 31 * result + (pubDate != null ? pubDate.hashCode() : 0);
        result = 31 * result + (pubMemberId != null ? pubMemberId.hashCode() : 0);
        result = 31 * result + (pubMemberName != null ? pubMemberName.hashCode() : 0);
        result = 31 * result + (shareId != null ? shareId.hashCode() : 0);
        result = 31 * result + (toMemberId != null ? toMemberId.hashCode() : 0);
        return result;
    }
}
